<template>
  <div class="base-page">
    <el-pagination
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :current-page="currentPage"
      :page-sizes="[5, 10]"
      :page-size="size"
      :layout="layout"
      :total="total"
    ></el-pagination>
  </div>
</template>

<script>
export default {
  props: {
    currentPage: {
      type: Number | String,
      default: 1
    },
    total: {
      type: Number | String,
      default: 400
    },
    size: {
      type: Number,
      default: 5
    },
    layout: {
      type: String,
      default: "total, sizes, prev, pager, next, jumper"
    }
  },
  methods: {
    handleSizeChange(val) {
      // console.log(`每页 ${val} 条`);
      this.$emit("sizeChange", val);
    },
    handleCurrentChange(val) {
      // console.log(`当前页: ${val}`);
      this.$emit("currentChange", val);
    }
  }
}
</script>

<style>
</style>